//
//  SLBlockButton.m
//  shunlianPower2
//
//  Created by 陈镇 on 2018/3/30.
//  Copyright © 2018年 顺联网络. All rights reserved.
//

#import "SLBlockButton.h"

@interface SLBlockButton()

@end

@implementation SLBlockButton

- (instancetype)initWithBlock:(nullable SLBlockButtonClick)block{
    if (self = [super init]) {
        self.block = block;
        [self addTarget:self action:@selector(buttonclick:) forControlEvents:UIControlEventTouchUpInside];
    }
    return self;
}

- (void)buttonclick:(SLBlockButton *)button{
    if (_block) {
        _block(self);
    }
}

@end
